Skip to main content

Identification

Session type

Session is a union type that implements either UserSession or AdminSession.


Interfaces

UserSession

The UserSession interface defines the structure of a user session.

Required Properties

  • token: string - A unique token used for authentication.
  • userKey: string - User key.
  • accountShortName: string - Account short name.
  • displayName: string - The user's display name.
  • objectType: 'user' - A constant string indicating that this is a user session.
  • loginMethod: { objectType: string } - An object describing the login method.
    • objectType: string specifies the type of login method. Possible values: NativeLoginMethod, SSOLoginMethod or NoneLoginMethod.

Optional Properties

  • groupKey?: string - When defined, indicates that in this session the user is logged in as a member of a group.
  • groupName?: string - The name of the group the user is associated with.
  • groupRole?: string - Defines the user's permissions. For a discussion fo user roles, read User session in the Developer guides.
  • multipleGroups?: boolean - A flag indicating that the user is a member of multiple groups and the session context cannot be selected by default.
  • projectShortName?: string - Project short name. Undefined when multipleGroups is true.
  • projectKey?: string - Project key.

AdminSession

The AdminSession interface defines the structure of an admin session.

Required Properties

  • adminHandle: string - The handle used to log in.
  • adminKey: string - A unique key identifying the admin.
  • expires: boolean - Indicates whether the session has an expiration.
  • multipleAccounts: boolean - A flag indicating that the admin is associated with multiple accounts and the session context cannot be selected by default.
  • objectType: "admin" - A constant string identifying the object type, always set to "admin".
  • teamAccountRole: string - Defines the admin's permissions. For a discussion fo admin roles, read Admin session in the Developer guides.
  • teamAccountShortName: string - A shortened or simplified name for the team account the admin is associated with. Undefined when multipleAccounts is true.
  • timeoutMinutes: number - The session timeout duration, in minutes.
  • token: string - A unique token used for authentication.

Optional Properties

  • projectShortName?: string - Project short name.
  • projectKey?: string - Project key.
  • groupKey?: string - Group key.